/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package l1j.server.server.templates;

import java.sql.Timestamp;

import l1j.server.server.datatables.ItemTable;
import l1j.server.server.model.L1BugBearRace;

/**
 *	商店道具
 */
public class L1ShopItem {
	/** 序列版本UID */
	private static final long serialVersionUID = 1L;
	/** 道具 */
	private L1Item _item;
	/** 道具ID */
	private final int _itemId;
	/** 价格 */
	private final int _price;
	/** 贩卖数量 */
	private final int _packCount;
	/** 商店直接卖+几武器 */
	private final int _EnchantLevel;
	/** 道具天数删除系统(指定天数) */
	private final int _deleteDay;
	/** 道具天数删除系统(指定日期) */
	private final Timestamp _deleteDate;
	/** 商店道具 */
	public L1ShopItem(int itemId, int price, int packCount, int EnchantLevel, int deleteDay, Timestamp deleteDate) { // 商店直接卖+几武器
		_itemId = itemId;
		_item = ItemTable.getInstance().getTemplate(itemId);
		_price = price;
		_packCount = packCount;
		_EnchantLevel = EnchantLevel;	// 商店直接卖+几武器
		_deleteDay = deleteDay;			// 道具天数删除系统(指定天数)
		_deleteDate = deleteDate;		// 道具天数删除系统(指定日期)
	}
	/** 返回的道具ID */
	public int getItemId() {
		return _itemId;
	}
	/** 返回的道具 */
	public L1Item getItem() {
		return _item;
	}
	/** 返回的价格 */
	public int getPrice() {
		return _price;
	}
	/** 返回的贩卖数量 */
	public int getPackCount() {
		return _packCount;
	}
	/** 返回的商店直接卖+几武器 */
	public int getEnchantLevel() {
		return _EnchantLevel;
	}

	/** 道具天数删除系统(指定天数) */
	public int getDeleteDay() {
		return _deleteDay;
	}

	/** 道具天数删除系统(指定日期) */
	public Timestamp getDeleteDate() {
		return _deleteDate;
	}

	/** 食人妖精賽跑用 */
	public void setName(int num) {
		int trueNum = L1BugBearRace.getInstance().getRunner(num).getNpcId() - 91350 + 1;
		_item = (L1Item) _item.clone();
		String temp = "" + _item.getIdentifiedNameId() + " "
				+ L1BugBearRace.getInstance().getRound() + "-" + trueNum;
		_item.setName(temp);
		_item.setUnidentifiedNameId(temp);
		_item.setIdentifiedNameId(temp);
	}
	/** 返回的序列版本UID */
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
